There are currently many schemes for allowing different threads of execution on a computer to communicate with one another. Typically, these schemes involve using the message passing mechanisms of the computer's operating system. However, there are many situations in which it is not desirable to call on these mechanisms from directly within a program. An example of such a situation is when the threads that wish to communicate are scripting threads. Scripting threads are simply threads that execute according to a scripting language, such as JavaScript or PERL. Programmers often prefer to use scripting languages rather than compiled languages because scripting languages hide a lot of the underlying complexity of the machines on which they run. This complexity is, instead, handled by the “script engine,” which is the name often given to the program that interprets the script. If a script programmer is forced to rely explicitly on the message passing facilities of the operating system, then he runs the risk of reintroducing some of the complexity that he sought to avoid by choosing a script language in the first place.
Thus it can be seen that there is a need for a method and system for passing messages between threads that avoids the above-mentioned disadvantages.